package file;

import java.io.File;

public class ListFilesDome3 {
    public static void main(String[] args){
        File dir=new File(".");
        if (dir.isDirectory()){
            File[] subs=dir.listFiles(file->file.getName().endsWith(".txt"));
            for (File sub:subs){
                System.out.println(sub.getName());
            }
        }

        /*
        File dir=new File(".");
        if (dir.isDirectory()){
            File[] subs=dir.listFiles(file->file.getName().endsWith(".txt"));
            for (File sub:subs){
                System.out.println(sub.getName());
            }

        }
         */
    }
}
